using System;
using System.Windows.Forms;
using SimpleGPSApp.Base;

namespace SimpleGPSApp
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [MTAThread]
        static void Main()
        {
            try
            {
                Root.StartupSettings();
                ApplicationHelper.LoadXmlFile<Settings>(ref Root.ApplicationSettings, Root.ConfigurationFile);
                ApplicationHelper.LoadXmlFile<Statistics>(ref Root.Statistics, Root.StatisticsFile);
                Application.Run(new GPSViewer());
            }
            catch(Exception e)
            {
                IRQ.BaseFunctions.ErrorLog.WriteError(Root.ErrorLogFileName, e.ToString());
            }
        }
    }
}